/*
 * ConfigurationManager.h
 *
 *  Created on: Oct 20, 2012
 *      Author: johnny
 */

#pragma once

#ifndef CONFIGURATIONMANAGER_H_
#define CONFIGURATIONMANAGER_H_

#include <iostream>
#include <list>
#include <boost/shared_ptr.hpp>

#include "MeasurementObject.h"
#include "MeasConnectionHandler.h"

namespace core {

class ConfigurationManager {
	ConfigurationManager();
    ConfigurationManager(ConfigurationManager const&) {}
    void operator=(ConfigurationManager const&) {}

    //std::list< boost::shared_ptr<measurement::MeasurementObject> > loadedMOs;
    std::list< boost::shared_ptr<measurement::MeasBase> > loadedMOs;
    MeasConnectionHandler connHandler;
public:
	virtual ~ConfigurationManager();

    bool loadCfg(std::string);
    bool saveCfg(std::string);
	void closeCfg();

    //void addMO(boost::shared_ptr<measurement::MeasurementObject> mo);
    //void removeMO(boost::shared_ptr<measurement::MeasurementObject> mo);
    void addMO(boost::shared_ptr<measurement::MeasBase> mo);
    void removeMO(boost::shared_ptr<measurement::MeasBase> mo);

    const std::list< boost::shared_ptr<measurement::MeasBase> >& getLoadedMOs();

    MeasConnectionHandler& getMeasConnHandler();
	static ConfigurationManager& getInstance();
};

} /* namespace core */
#endif /* CONFIGURATIONMANAGER_H_ */
